﻿using System.Collections.Generic;

namespace EzDesk.DevHelper.EzMLGenerator.EzML
{
    class EzMLBuilder
    {
        private string textSource;

        List<EzMLProcessor> processors = new List<EzMLProcessor>();

        public EzMLBuilder(string textSource, string sectionName)
        {
            this.textSource = textSource;

            processors.Add(new StrongProcessor());
            processors.Add(new WeakProcessor());
            processors.Add(new UserInfoProcessor());
            processors.Add(new NewLineProcessor());
            processors.Add(new ReplacementProcessor());
            processors.Add(new ReplaceTextProcessor());
            processors.Add(new ImptProcessor());
            processors.Add(new LinkProcessor());
            processors.Add(new BasicInfoProcessor(sectionName));
            
        }

        public string Build()       
        {
            string source = textSource;
            foreach (var processor in processors)
            {
                source = processor.Process(source);
            }
            return source;
        }
    }
}
